package com.haikesi.api.sysarea.controller;

import com.haikesi.api.base.ApiIndex;
import com.haikesi.api.base.R;
import com.haikesi.api.base.annotation.Token;
import com.haikesi.api.sysarea.domain.vo.SysAreaVO;
import com.haikesi.api.sysarea.domain.vo.SysSearchAreaVO;
import com.haikesi.api.sysarea.service.ISysAreaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Api(description = "系统区域相关接口", tags = ApiIndex.SysAreaController)
@RequestMapping(value = "/api/sysarea")
@RestController
public class SysAreaController {

    @Autowired
    private ISysAreaService service;

    @ApiOperation(value = "查询列表")
    @GetMapping(value = "/list")
    @ApiImplicitParam(name = "token", value = "签名", paramType = "query", dataType = "String")
    @Token
    public R<List<SysAreaVO>> list(@ApiParam(value = "查询参数") @ModelAttribute SysSearchAreaVO searchAreaVO) {
        List<SysAreaVO> list = service.getList(searchAreaVO);
        return new R(list);
    }

}
